﻿using System;
using System.Windows.Forms;
using HYCodeBase.WinForm.WinFormRemindSuit;

namespace QuickModel.Models
{
	public class NumericUpDownControlInfoTransform : ICustomControlInfoTransform
	{
		public string GetControlStr(System.Windows.Forms.Control inputControl)
		{
			NumericUpDown numericUpDown = inputControl as NumericUpDown;
			bool flag = numericUpDown == null;
			string result;
			if (flag)
			{
				result = "";
			}
			else
			{
				result = numericUpDown.Text;
			}
			return result;
		}

		public void SetControlStr(ref System.Windows.Forms.Control inputControl, string inputStr)
		{
			NumericUpDown numericUpDown = inputControl as NumericUpDown;
			bool flag = numericUpDown == null;
			if (!flag)
			{
				decimal value = 0m;
				bool flag2 = decimal.TryParse(inputStr, out value);
				if (flag2)
				{
					numericUpDown.Value = value;
				}
			}
		}
	}
}
